package com.example.demo.model;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName order
 */

public class Order implements Serializable {
    /**
     *
     */

    private Integer orderId;

    /**
     *
     */
    private String orderName;

    /**
     *
     */
    private Date orderDate;

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    public Integer getOrderId() {
        return orderId;
    }

    /**
     *
     */
    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    /**
     *
     */
    public String getOrderName() {
        return orderName;
    }

    /**
     *
     */
    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    /**
     *
     */
    public Date getOrderDate() {
        return orderDate;
    }

    /**
     *
     */
    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Order other = (Order) that;
        return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
                && (this.getOrderName() == null ? other.getOrderName() == null : this.getOrderName().equals(other.getOrderName()))
                && (this.getOrderDate() == null ? other.getOrderDate() == null : this.getOrderDate().equals(other.getOrderDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getOrderName() == null) ? 0 : getOrderName().hashCode());
        result = prime * result + ((getOrderDate() == null) ? 0 : getOrderDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", orderId=").append(orderId);
        sb.append(", orderName=").append(orderName);
        sb.append(", orderDate=").append(orderDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    public Order(String orderName, Date orderDate) {
        this.orderName = orderName;
        this.orderDate = orderDate;
    }

    public Order() {
    }
}